package cloudgamesaumysql

import (
	"gorm.io/gorm"
	"time"
)

/*
  @author liubogeng
  @date   2024/8/27 15:22
*/

// CGGameAURecord 云游戏AU记录表
type CGGameAURecord struct {
	ID                                 int64          `json:"id" gorm:"column:id;type:bigint;primaryKey;autoIncrement;comment:ID"`
	CID                                string         `json:"c_id" gorm:"column:c_id;type:varchar(500);not null;default:'';comment:用户使用云游戏服务的唯一标识"`
	UserID                             int64          `json:"user_id" gorm:"column:user_id;type:bigint;not null;default:0;comment:用户ID"`
	Phone                              string         `json:"phone" gorm:"column:phone;type:varchar(20);not null;default:'';comment:用户手机号"`
	NickName                           string         `json:"nick_name" gorm:"column:nick_name;type:varchar(32);not null;default:'';comment:用户昵称"`
	Avatar                             string         `json:"avatar" gorm:"column:avatar;type:varchar(64);not null;default:'';comment:用户头像"`
	GameBeginningTime                  time.Time      `json:"game_beginning_time" gorm:"column:game_beginning_time;type:datetime;default:null;comment:游戏开始时间"`
	GameBeginningUserAvailableDuration int64          `json:"game_beginning_user_available_duration" gorm:"column:game_beginning_user_available_duration;type:bigint;not null;default:0;comment:游戏开始时用户的剩余可用时长（所有种类时长的总和）"`
	GameConsumedDuration               int64          `json:"consumed_duration" gorm:"column:consumed_duration;type:bigint;not null;default:0;comment:本次游戏的消耗时长"`
	GameEndTime                        time.Time      `json:"game_end_time" gorm:"column:game_end_time;type:datetime;default:null;comment:游戏结束时间"`
	CreatedAt                          time.Time      `json:"created_at" gorm:"column:created_at;type:datetime;comment:该条记录创建时间"`
	UpdatedAt                          time.Time      `json:"updated_at" gorm:"column:updated_at;type:datetime;comment:该条记录修改时间"`
	DeletedAt                          gorm.DeletedAt `json:"-" gorm:"index;type:datetime;comment:该条记录删除时间"`
}

func (CGGameAURecord) TableName() string {
	return "cg_game_au_record"
}
